<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/22
 * Time: 13:07
 */
namespace phpfuntions\mp_file;
//文件操作类函数

class myphp_fileSystem_operate
{
    /**
     * chgrp  函数：改变文件所属的组　
     * @access public
     * @return
     */
    public static function chgrp ($filename, $group) {
        return chgrp($filename, $group );

    }

    /**
     * chmod  函数：改变文件的访问模式　
     * @access public
     * @return
     */
    public static function chmod ($filename, $mode) {
        return chmod( $filename, $mode);

    }

    /**
     * chown  函数：修改文件的所有者　
     * @access public
     * @return
     */
    public static function chown ($filename, $user) {
        return chown( $filename, $user);

    }

    /**
     *clearstatcache  函数：清除文件状态缓存
     * @access public
     * @return
     */
    public static function clearstatcache ($clear_realpath_cache = null, $filename = null) {
        return clearstatcache( $clear_realpath_cache, $filename);

    }

    /**
     * copy  函数：复制文件　
     * @access public
     * @return
     */
    public static function copy ($source, $dest, $context = null) {
        return copy( $source, $dest, $context );

    }


    /**
     * flock  函数：锁定文件　
     * @access public
     * @return
     */
    public static function flock ($handle, $operation, &$wouldblock = null) {
        return flock( $handle, $operation, $wouldblock );

    }

    /**
     * fpassthru  函数：输出文件中的剩余数据　
     * @access public
     * @return
     */
    public static function fpassthru ($handle) {
        return fpassthru( $handle);

    }

    /**
     *fputcsv  函数：将行数据格式化为CSV格式并写入文件
     * @access public
     * @return
     */
    public static function fputcsv ($handle, array $fields, $delimiter = ",", $enclosure = '"', $escape_char = "\\") {
        return fputcsv($handle, $fields, $delimiter , $enclosure , $escape_char );

    }

    /**
     * fputs  函数：将字符串写入文件　
     * @access public
     * @return
     */
    public static function fputs ($handle, $string, $length) {
        return fputs( $handle, $string, $length);

    }
    /**
     *fread  函数：读取文件内容
     * @access public
     * @return
     */
    public static function fread ($handle, $length) {
        return fread($handle, $length );

    }
    /**
     * fscanf  函数：将文件内容格式化输出　
     * @access public
     * @return
     */
    public static function fscanf ($handle, $format, &$_ = null) {
        return fscanf( $handle, $format, $_ );

    }
    /**
     * fseek  函数：在文件中设置指针位置　
     * @access public
     * @return
     */
    public static function fseek ($handle, $offset, $whence = SEEK_SET) {
        return fseek( $handle, $offset, $whence);

    }
    /**
     * ftruncate  函数：将文件截断到指定的长度　
     * @access public
     * @return
     */
    public static function ftruncate ($handle, $size) {
        return ftruncate( $handle, $size);

    }
    /**
     * fwrite  函数：写入文件　
     * @access public
     * @return
     */
    public static function fwrite ($handle, $string, $length = null) {
        return fwrite( $handle, $string, $length );

    }
    /**
     * glob  函数：查找与模式匹配的文件路径　
     * @access public
     * @return
     */
    public static function glob ($pattern, $flags = null) {
        return glob( $pattern, $flags );

    }
    /**
     * link  函数：建立硬连接　
     * @access public
     * @return
     */
    public static function link (string $target , string $link) {
        return link( $target , $link);

    }
    /**
     *move_uploaded_file  函数：将上传的文件移动到新位置
     * @access public
     * @return
     */
    public static function move_uploaded_file ($filename, $destination) {
        return move_uploaded_file( $filename, $destination);

    }
    /**
     *parse_ini_file  函数：解析一个配置文件
     * @access public
     * @return
     */
    public static function parse_ini_file ($filename, $process_sections = false, $scanner_mode = INI_SCANNER_NORMAL) {
        return parse_ini_file( $filename, $process_sections , $scanner_mode );

    }
    /**
     *readfile  函数：输出一个文件的内容
     * @access public
     * @return
     */
    public static function readfile ($filename, $use_include_path = null, $context = null) {
        return readfile( $filename, $use_include_path, $context );

    }
    /**
     *rename  函数：重命名一个文件或目录
     * @access public
     * @return
     */
    public static function rename ($oldname, $newname, $context = null) {
        return rename( $oldname, $newname, $context );

    }
    /**
     *rewind  函数：倒回文件指针
     * @access public
     * @return
     */
    public static function rewind ($handle) {
        return rewind( $handle);

    }
    /**
     * set_file_buffer  函数：设置文件缓冲区大小　
     * @access public
     * @return
     */
    public static function set_file_buffer () {
        return set_file_buffer( );

    }
    /**
     *tempnam  函数：在指定目录下建立临时文件
     * @access public
     * @return
     */
    public static function tempnam ($fp, $buffer) {
        return tempnam( $fp, $buffer);

    }
    /**
     *touch  函数：修改文件时间
     * @access public
     * @return
     */
    public static function touch ($filename, $time = null, $atime = null) {
        return touch( $filename, $time , $atime);

    }
    /**
     * unlink  函数：删除文件　
     * @access public
     * @return
     */
    public static function unlink ($filename, $context = null) {
        return unlink($filename, $context  );

    }




}